from django.contrib import admin
from .models import CourseModel, LessonModel, VideoModel, CourseResourceModel


@admin.register(CourseModel)
class CourseAdmin(admin.ModelAdmin):
    list_display = ['id', 'course_org', 'teacher', 'teacher_tell', 'name', 'tag', 'category', 'you_need_know', 'is_banner', 'learn_times', 'students', 'fav_nums', 'click_nums', 'add_time']
    list_display_links = ['name']


@admin.register(LessonModel)
class LessonAdmin(admin.ModelAdmin):
    list_display = ['id', 'course', 'name', 'add_time']
    list_display_links = ['name']


@admin.register(VideoModel)
class VideoAdmin(admin.ModelAdmin):
    list_display = ['id', 'lesson', 'name', 'url', 'learn_times', 'add_time']
    list_display_links = ['name']


@admin.register(CourseResourceModel)
class CourseResourceAdmin(admin.ModelAdmin):
    list_display = ['id', 'course', 'name', 'add_time']
    list_display_links = ['name']